package com.kingwang.training.designpattern.visitor.bo;

/**
 * 如果不使用Visitor，需要用类似下面的代码
 *
 * @author King
 */
public class ReportUtil {
    public void showReport(Staff staff) {
        if (staff instanceof Manager) {
            Manager manager = (Manager) staff;
            System.out.println("经理: " + manager.getName() + ", KPI: " + manager.getKpi() + ", 新产品数量: " + manager.getProducts());
        } else if (staff instanceof Engineer) {
            Engineer engineer = (Engineer) staff;
            System.out.println("工程师: " + engineer.getName() + ", KPI: " + engineer.getKpi());
        }
    }
}
